<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num1 = prompt('请输入第一个值')
        let num2 = prompt('请输入第二个值')
        let tmp = ''
        exchange = (num1, num2) => {
            tmp = num1
            num1 = num2
            num2 = tmp
            document.write(num1, num2)
        }
        exchange(num1, num2)
        // function exchange() {
        //     tmp = num1
        //     num1 = num2
        //     num2 = tmp
        // }
        // console.log(num1, num2 + '3');
        // console.log(`num1为${num1},num2为${num2}`)
        // let a=123
        // let b=456
        // a=[b,b=a][0]
        // console.log(a,b);
    </script>
</body>

</html>